package bill.study.concurrency.synchronizer.exchanger.brian.goetz;

import java.util.List;
import java.util.Random;

public class DataBuffer {

	private final int bufferSize = 5;
	private final List<String> buffer ;
	
	DataBuffer(List<String> buf){
		this.buffer = buf;
	}
	public boolean full() {
		return buffer.size() >= bufferSize;
	}
	
	public void add(String str){
		this.buffer.add(str);
	}
    public String remove(){
    	if(this.buffer.size()>=1)
    	return this.buffer.remove(0);
    	else
    		return "Nothing";
    }
	public boolean empty() {
		return buffer.size() ==0;
	}

}
